home *** CD-ROM | disk | FTP | other *** search
MacBinary | 2000-02-25 | 10.6 KB | [TEXT/CWIE] |
open in:
MacOS 8.1
|
Win98
|
DOS
browse contents |
view JSON data
|
view as text
This file was processed as: MacBinary
(archive/macBinary).
Confidence | Program | Detection | Match Type | Support
|
---|
66%
| dexvert
| Compact Compressed (Unix) (archive/compact)
| ext
| Supported |
10%
| dexvert
| MacBinary (archive/macBinary)
| fallback
| Supported |
1%
| dexvert
| Text File (text/txt)
| fallback
| Supported |
100%
| file
| MacBinary II, Fri Feb 25 05:00:00 2000, modified Fri Feb 25 05:00:00 2000, creator 'CWIE', type ASCII, 10364 bytes "WEObjects.c" , at 0x28fc 286 bytes resource
| default (weak)
| |
99%
| file
| data
| default
| |
74%
| TrID
| Macintosh plain text (MacBinary)
| default
| |
25%
| TrID
| MacBinary 2
| default (weak)
| |
100%
| siegfried
| fmt/1762 MacBinary (II)
| default
| |
100%
| lsar
| MacBinary
| default
|
|
id metadata |
---|
key | value |
---|
macFileType | [TEXT] |
macFileCreator | [CWIE] |
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 0b 57 45 4f 62 6a 65 | 63 74 73 2e 63 00 00 00 |..WEObje|cts.c...|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 43 57 49 | 45 00 00 00 00 00 00 00 |.TEXTCWI|E.......|
|00000050| 00 00 00 00 00 28 7c 00 | 00 01 1e b4 dc 03 20 b4 |.....(|.|...... .|
|00000060| dc 03 20 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |.. .....|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 3d bf 00 00 |........|....=...|
|00000080| 2f 2a 0d 20 2a 09 57 45 | 4f 62 6a 65 63 74 73 2e |/*. *.WE|Objects.|
|00000090| 63 0d 20 2a 0d 20 2a 09 | 57 41 53 54 45 20 50 52 |c. *. *.|WASTE PR|
|000000a0| 4f 4a 45 43 54 0d 20 2a | 20 20 45 6d 62 65 64 64 |OJECT. *| Embedd|
|000000b0| 65 64 20 4f 62 6a 65 63 | 74 73 0d 20 2a 0d 20 2a |ed Objec|ts. *. *|
|000000c0| 20 20 43 6f 70 79 72 69 | 67 68 74 20 28 63 29 20 | Copyri|ght (c) |
|000000d0| 31 39 39 33 2d 31 39 39 | 38 20 4d 61 72 63 6f 20 |1993-199|8 Marco |
|000000e0| 50 69 6f 76 61 6e 65 6c | 6c 69 0d 20 2a 09 41 6c |Piovanel|li. *.Al|
|000000f0| 6c 20 52 69 67 68 74 73 | 20 52 65 73 65 72 76 65 |l Rights| Reserve|
|00000100| 64 0d 20 2a 0d 20 2a 20 | 20 43 20 70 6f 72 74 20 |d. *. * | C port |
|00000110| 62 79 20 44 61 6e 20 43 | 72 65 76 69 65 72 0d 20 |by Dan C|revier. |
|00000120| 2a 0d 20 2a 2f 0d 0d 0d | 23 69 6e 63 6c 75 64 65 |*. */...|#include|
|00000130| 20 22 57 41 53 54 45 49 | 6e 74 66 2e 68 22 0d 0d | "WASTEI|ntf.h"..|
|00000140| 23 69 66 20 57 41 53 54 | 45 5f 4f 42 4a 45 43 54 |#if WAST|E_OBJECT|
|00000150| 53 0d 0d 2f 2f 20 73 74 | 61 74 69 63 20 76 61 72 |S..// st|atic var|
|00000160| 69 61 62 6c 65 73 0d 0d | 73 74 61 74 69 63 20 57 |iables..|static W|
|00000170| 45 4f 48 54 61 62 6c 65 | 48 61 6e 64 6c 65 20 5f |EOHTable|Handle _|
|00000180| 77 65 47 6c 6f 62 61 6c | 4f 62 6a 65 63 74 48 61 |weGlobal|ObjectHa|
|00000190| 6e 64 6c 65 72 54 61 62 | 6c 65 3b 0d 0d 70 61 73 |ndlerTab|le;..pas|
|000001a0| 63 61 6c 20 46 6c 61 76 | 6f 72 54 79 70 65 20 57 |cal Flav|orType W|
|000001b0| 45 47 65 74 4f 62 6a 65 | 63 74 54 79 70 65 28 57 |EGetObje|ctType(W|
|000001c0| 45 4f 62 6a 65 63 74 44 | 65 73 63 48 61 6e 64 6c |EObjectD|escHandl|
|000001d0| 65 20 68 4f 62 6a 65 63 | 74 44 65 73 63 29 0d 7b |e hObjec|tDesc).{|
|000001e0| 0d 09 72 65 74 75 72 6e | 20 28 2a 68 4f 62 6a 65 |..return| (*hObje|
|000001f0| 63 74 44 65 73 63 29 2d | 3e 6f 62 6a 65 63 74 54 |ctDesc)-|>objectT|
|00000200| 79 70 65 3b 0d 7d 0d 0d | 70 61 73 63 61 6c 20 48 |ype;.}..|pascal H|
|00000210| 61 6e 64 6c 65 20 57 45 | 47 65 74 4f 62 6a 65 63 |andle WE|GetObjec|
|00000220| 74 44 61 74 61 48 61 6e | 64 6c 65 28 57 45 4f 62 |tDataHan|dle(WEOb|
|00000230| 6a 65 63 74 44 65 73 63 | 48 61 6e 64 6c 65 20 68 |jectDesc|Handle h|
|00000240| 4f 62 6a 65 63 74 44 65 | 73 63 29 0d 7b 0d 09 72 |ObjectDe|sc).{..r|
|00000250| 65 74 75 72 6e 20 28 2a | 68 4f 62 6a 65 63 74 44 |eturn (*|hObjectD|
|00000260| 65 73 63 29 2d 3e 6f 62 | 6a 65 63 74 44 61 74 61 |esc)->ob|jectData|
|00000270| 48 61 6e 64 6c 65 3b 0d | 7d 0d 0d 70 61 73 63 61 |Handle;.|}..pasca|
|00000280| 6c 20 50 6f 69 6e 74 20 | 57 45 47 65 74 4f 62 6a |l Point |WEGetObj|
|00000290| 65 63 74 53 69 7a 65 28 | 57 45 4f 62 6a 65 63 74 |ectSize(|WEObject|
|000002a0| 44 65 73 63 48 61 6e 64 | 6c 65 20 68 4f 62 6a 65 |DescHand|le hObje|
|000002b0| 63 74 44 65 73 63 29 0d | 7b 0d 09 72 65 74 75 72 |ctDesc).|{..retur|
|000002c0| 6e 20 28 2a 68 4f 62 6a | 65 63 74 44 65 73 63 29 |n (*hObj|ectDesc)|
|000002d0| 2d 3e 6f 62 6a 65 63 74 | 53 69 7a 65 3b 0d 7d 0d |->object|Size;.}.|
|000002e0| 0d 70 61 73 63 61 6c 20 | 57 45 48 61 6e 64 6c 65 |.pascal |WEHandle|
|000002f0| 20 57 45 47 65 74 4f 62 | 6a 65 63 74 4f 77 6e 65 | WEGetOb|jectOwne|
|00000300| 72 28 57 45 4f 62 6a 65 | 63 74 44 65 73 63 48 61 |r(WEObje|ctDescHa|
|00000310| 6e 64 6c 65 20 68 4f 62 | 6a 65 63 74 44 65 73 63 |ndle hOb|jectDesc|
|00000320| 29 0d 7b 0d 09 72 65 74 | 75 72 6e 20 28 2a 68 4f |).{..ret|urn (*hO|
|00000330| 62 6a 65 63 74 44 65 73 | 63 29 2d 3e 6f 62 6a 65 |bjectDes|c)->obje|
|00000340| 63 74 4f 77 6e 65 72 3b | 0d 7d 0d 0d 70 61 73 63 |ctOwner;|.}..pasc|
|00000350| 61 6c 20 53 49 6e 74 33 | 32 20 57 45 47 65 74 4f |al SInt3|2 WEGetO|
|00000360| 62 6a 65 63 74 52 65 66 | 43 6f 6e 28 57 45 4f 62 |bjectRef|Con(WEOb|
|00000370| 6a 65 63 74 44 65 73 63 | 48 61 6e 64 6c 65 20 68 |jectDesc|Handle h|
|00000380| 4f 62 6a 65 63 74 44 65 | 73 63 29 0d 7b 0d 09 72 |ObjectDe|sc).{..r|
|00000390| 65 74 75 72 6e 20 28 2a | 68 4f 62 6a 65 63 74 44 |eturn (*|hObjectD|
|000003a0| 65 73 63 29 2d 3e 6f 62 | 6a 65 63 74 52 65 66 43 |esc)->ob|jectRefC|
|000003b0| 6f 6e 3b 0d 7d 0d 0d 70 | 61 73 63 61 6c 20 76 6f |on;.}..p|ascal vo|
|000003c0| 69 64 20 57 45 53 65 74 | 4f 62 6a 65 63 74 52 65 |id WESet|ObjectRe|
|000003d0| 66 43 6f 6e 28 57 45 4f | 62 6a 65 63 74 44 65 73 |fCon(WEO|bjectDes|
|000003e0| 63 48 61 6e 64 6c 65 20 | 68 4f 62 6a 65 63 74 44 |cHandle |hObjectD|
|000003f0| 65 73 63 2c 20 53 49 6e | 74 33 32 20 72 65 66 43 |esc, SIn|t32 refC|
|00000400| 6f 6e 29 0d 7b 0d 09 28 | 2a 68 4f 62 6a 65 63 74 |on).{..(|*hObject|
|00000410| 44 65 73 63 29 2d 3e 6f | 62 6a 65 63 74 52 65 66 |Desc)->o|bjectRef|
|00000420| 43 6f 6e 20 3d 20 72 65 | 66 43 6f 6e 3b 0d 7d 0d |Con = re|fCon;.}.|
|00000430| 0d 70 61 73 63 61 6c 20 | 53 49 6e 74 33 32 20 5f |.pascal |SInt32 _|
|00000440| 57 45 4c 6f 6f 6b 75 70 | 4f 62 6a 65 63 74 54 79 |WELookup|ObjectTy|
|00000450| 70 65 28 46 6c 61 76 6f | 72 54 79 70 65 20 6f 62 |pe(Flavo|rType ob|
|00000460| 6a 65 63 74 54 79 70 65 | 2c 20 57 45 4f 48 54 61 |jectType|, WEOHTa|
|00000470| 62 6c 65 48 61 6e 64 6c | 65 20 68 54 61 62 6c 65 |bleHandl|e hTable|
|00000480| 29 0d 7b 0d 09 2f 2f 20 | 6c 6f 6f 6b 20 66 6f 72 |).{..// |look for|
|00000490| 20 61 20 57 45 4f 48 54 | 61 62 6c 65 45 6e 74 72 | a WEOHT|ableEntr|
|000004a0| 79 20 72 65 63 6f 72 64 | 20 66 6f 72 20 74 68 65 |y record| for the|
|000004b0| 20 73 70 65 63 69 66 69 | 65 64 20 6f 62 6a 65 63 | specifi|ed objec|
|000004c0| 74 20 6b 69 6e 64 0d 09 | 2f 2f 20 69 6e 20 74 68 |t kind..|// in th|
|000004d0| 65 20 67 69 76 65 6e 20 | 6f 62 6a 65 63 74 20 68 |e given |object h|
|000004e0| 61 6e 64 6c 65 72 20 74 | 61 62 6c 65 0d 0d 09 53 |andler t|able...S|
|000004f0| 49 6e 74 33 32 20 6e 45 | 6e 74 72 69 65 73 2c 20 |Int32 nE|ntries, |
|00000500| 69 6e 64 65 78 3b 0d 09 | 57 45 4f 48 54 61 62 6c |index;..|WEOHTabl|
|00000510| 65 45 6e 74 72 79 20 2a | 70 54 61 62 6c 65 3b 0d |eEntry *|pTable;.|
|00000520| 0d 09 2f 2f 20 64 6f 20 | 6e 6f 74 68 69 6e 67 20 |..// do |nothing |
|00000530| 69 66 20 74 68 65 20 4f | 62 6a 65 63 74 20 48 61 |if the O|bject Ha|
|00000540| 6e 64 6c 65 72 20 54 61 | 62 6c 65 20 68 61 73 20 |ndler Ta|ble has |
|00000550| 6e 6f 74 20 62 65 65 6e | 20 69 6e 69 74 65 64 20 |not been| inited |
|00000560| 79 65 74 0d 09 69 66 20 | 28 68 54 61 62 6c 65 20 |yet..if |(hTable |
|00000570| 3d 3d 20 6e 69 6c 29 0d | 09 7b 0d 09 09 72 65 74 |== nil).|.{...ret|
|00000580| 75 72 6e 20 6b 55 6e 6b | 6e 6f 77 6e 4f 62 6a 65 |urn kUnk|nownObje|
|00000590| 63 74 54 79 70 65 3b 0d | 09 7d 0d 0d 09 2f 2f 20 |ctType;.|.}...// |
|000005a0| 63 61 6c 63 75 6c 61 74 | 65 20 65 6e 74 72 79 20 |calculat|e entry |
|000005b0| 63 6f 75 6e 74 0d 09 6e | 45 6e 74 72 69 65 73 20 |count..n|Entries |
|000005c0| 3d 20 47 65 74 48 61 6e | 64 6c 65 53 69 7a 65 28 |= GetHan|dleSize(|
|000005d0| 28 48 61 6e 64 6c 65 29 | 20 68 54 61 62 6c 65 29 |(Handle)| hTable)|
|000005e0| 20 2f 20 73 69 7a 65 6f | 66 28 57 45 4f 48 54 61 | / sizeo|f(WEOHTa|
|000005f0| 62 6c 65 45 6e 74 72 79 | 29 3b 0d 0d 09 2f 2f 20 |bleEntry|);...// |
|00000600| 73 63 61 6e 20 74 68 65 | 20 4f 62 6a 65 63 74 20 |scan the| Object |
|00000610| 48 61 6e 64 6c 65 72 20 | 54 61 62 6c 65 20 6c 6f |Handler |Table lo|
|00000620| 6f 6b 69 6e 67 20 66 6f | 72 20 61 20 74 79 70 65 |oking fo|r a type|
|00000630| 20 6d 61 74 63 68 0d 09 | 70 54 61 62 6c 65 20 3d | match..|pTable =|
|00000640| 20 2a 68 54 61 62 6c 65 | 3b 0d 09 66 6f 72 20 28 | *hTable|;..for (|
|00000650| 20 69 6e 64 65 78 20 3d | 20 30 3b 20 69 6e 64 65 | index =| 0; inde|
|00000660| 78 20 3c 20 6e 45 6e 74 | 72 69 65 73 3b 20 69 6e |x < nEnt|ries; in|
|00000670| 64 65 78 2b 2b 20 29 0d | 09 7b 0d 09 09 69 66 20 |dex++ ).|.{...if |
|00000680| 28 70 54 61 62 6c 65 2d | 3e 6f 62 6a 65 63 74 54 |(pTable-|>objectT|
|00000690| 79 70 65 20 3d 3d 20 6f | 62 6a 65 63 74 54 79 70 |ype == o|bjectTyp|
|000006a0| 65 29 0d 09 09 7b 0d 09 | 09 09 72 65 74 75 72 6e |e)...{..|..return|
|000006b0| 20 69 6e 64 65 78 3b 0d | 09 09 7d 0d 09 09 70 54 | index;.|..}...pT|
|000006c0| 61 62 6c 65 2b 2b 3b 0d | 09 7d 0d 0d 09 72 65 74 |able++;.|.}...ret|
|000006d0| 75 72 6e 20 6b 55 6e 6b | 6e 6f 77 6e 4f 62 6a 65 |urn kUnk|nownObje|
|000006e0| 63 74 54 79 70 65 3b 0d | 7d 0d 0d 70 61 73 63 61 |ctType;.|}..pasca|
|000006f0| 6c 20 4f 53 45 72 72 20 | 5f 57 45 47 65 74 49 6e |l OSErr |_WEGetIn|
|00000700| 64 4f 62 6a 65 63 74 54 | 79 70 65 28 53 49 6e 74 |dObjectT|ype(SInt|
|00000710| 33 32 20 69 6e 64 65 78 | 2c 20 46 6c 61 76 6f 72 |32 index|, Flavor|
|00000720| 54 79 70 65 20 2a 6f 62 | 6a 65 63 74 54 79 70 65 |Type *ob|jectType|
|00000730| 2c 20 57 45 48 61 6e 64 | 6c 65 20 68 57 45 29 0d |, WEHand|le hWE).|
|00000740| 7b 0d 09 57 45 4f 48 54 | 61 62 6c 65 48 61 6e 64 |{..WEOHT|ableHand|
|00000750| 6c 65 20 68 54 61 62 6c | 65 3b 0d 09 53 49 6e 74 |le hTabl|e;..SInt|
|00000760| 33 32 20 6e 45 6e 74 72 | 69 65 73 3b 0d 0d 09 2a |32 nEntr|ies;...*|
|00000770| 6f 62 6a 65 63 74 54 79 | 70 65 20 3d 20 30 4c 3b |objectTy|pe = 0L;|
|00000780| 0d 0d 09 2f 2f 20 69 6e | 64 65 78 20 6d 75 73 74 |...// in|dex must|
|00000790| 20 62 65 20 6e 6f 6e 2d | 6e 65 67 61 74 69 76 65 | be non-|negative|
|000007a0| 0d 09 69 66 20 28 69 6e | 64 65 78 20 3c 20 30 29 |..if (in|dex < 0)|
|000007b0| 0d 09 7b 0d 09 09 72 65 | 74 75 72 6e 20 77 65 55 |..{...re|turn weU|
|000007c0| 6e 6b 6e 6f 77 6e 4f 62 | 6a 65 63 74 54 79 70 65 |nknownOb|jectType|
|000007d0| 45 72 72 3b 0d 09 7d 0d | 0d 09 2f 2f 20 63 61 6c |Err;..}.|..// cal|
|000007e0| 63 75 6c 61 74 65 20 6e | 75 6d 62 65 72 20 6f 66 |culate n|umber of|
|000007f0| 20 65 6e 74 72 69 65 73 | 20 69 6e 20 74 68 65 20 | entries| in the |
|00000800| 69 6e 73 74 61 6e 63 65 | 2d 73 70 65 63 69 66 69 |instance|-specifi|
|00000810| 63 20 68 61 6e 64 6c 65 | 72 20 74 61 62 6c 65 0d |c handle|r table.|
|00000820| 09 6e 45 6e 74 72 69 65 | 73 20 3d 20 30 3b 0d 09 |.nEntrie|s = 0;..|
|00000830| 68 54 61 62 6c 65 20 3d | 20 28 2a 68 57 45 29 2d |hTable =| (*hWE)-|
|00000840| 3e 68 4f 62 6a 65 63 74 | 48 61 6e 64 6c 65 72 54 |>hObject|HandlerT|
|00000850| 61 62 6c 65 3b 0d 09 69 | 66 20 28 68 54 61 62 6c |able;..i|f (hTabl|
|00000860| 65 20 21 3d 20 6e 69 6c | 29 0d 09 7b 0d 09 09 6e |e != nil|)..{...n|
|00000870| 45 6e 74 72 69 65 73 20 | 3d 20 47 65 74 48 61 6e |Entries |= GetHan|
|00000880| 64 6c 65 53 69 7a 65 28 | 28 48 61 6e 64 6c 65 29 |dleSize(|(Handle)|
|00000890| 20 68 54 61 62 6c 65 29 | 20 2f 20 73 69 7a 65 6f | hTable)| / sizeo|
|000008a0| 66 28 57 45 4f 48 54 61 | 62 6c 65 45 6e 74 72 79 |f(WEOHTa|bleEntry|
|000008b0| 29 3b 0d 09 7d 0d 0d 09 | 2f 2f 20 6c 6f 77 20 69 |);..}...|// low i|
|000008c0| 6e 64 69 63 65 73 20 72 | 65 66 65 72 20 74 6f 20 |ndices r|efer to |
|000008d0| 74 68 65 20 69 6e 73 74 | 61 6e 63 65 2d 73 70 65 |the inst|ance-spe|
|000008e0| 63 69 66 69 63 20 68 61 | 6e 64 6c 65 72 20 74 61 |cific ha|ndler ta|
|000008f0| 62 6c 65 0d 09 69 66 20 | 28 69 6e 64 65 78 20 3c |ble..if |(index <|
|00000900| 20 6e 45 6e 74 72 69 65 | 73 29 0d 09 7b 0d 09 09 | nEntrie|s)..{...|
|00000910| 2a 6f 62 6a 65 63 74 54 | 79 70 65 20 3d 20 28 2a |*objectT|ype = (*|
|00000920| 68 54 61 62 6c 65 29 5b | 69 6e 64 65 78 5d 2e 6f |hTable)[|index].o|
|00000930| 62 6a 65 63 74 54 79 70 | 65 3b 0d 09 09 72 65 74 |bjectTyp|e;...ret|
|00000940| 75 72 6e 20 6e 6f 45 72 | 72 3b 0d 09 7d 0d 09 2f |urn noEr|r;..}../|
|00000950| 2f 20 69 6e 64 69 63 65 | 73 20 61 62 6f 76 65 20 |/ indice|s above |
|00000960| 74 68 61 74 20 72 65 66 | 65 72 20 74 6f 20 74 68 |that ref|er to th|
|00000970| 65 20 67 6c 6f 62 61 6c | 20 68 61 6e 64 6c 65 72 |e global| handler|
|00000980| 20 74 61 62 6c 65 0d 09 | 69 6e 64 65 78 20 2d 3d | table..|index -=|
|00000990| 20 6e 45 6e 74 72 69 65 | 73 3b 0d 0d 09 2f 2f 20 | nEntrie|s;...// |
|000009a0| 63 61 6c 63 75 6c 61 74 | 65 20 6e 75 6d 62 65 72 |calculat|e number|
|000009b0| 20 6f 66 20 65 6e 74 72 | 69 65 73 20 69 6e 20 74 | of entr|ies in t|
|000009c0| 68 65 20 67 6c 6f 62 61 | 6c 20 68 61 6e 64 6c 65 |he globa|l handle|
|000009d0| 72 20 74 61 62 6c 65 0d | 09 6e 45 6e 74 72 69 65 |r table.|.nEntrie|
|000009e0| 73 20 3d 20 30 3b 0d 09 | 68 54 61 62 6c 65 20 3d |s = 0;..|hTable =|
|000009f0| 20 5f 77 65 47 6c 6f 62 | 61 6c 4f 62 6a 65 63 74 | _weGlob|alObject|
|00000a00| 48 61 6e 64 6c 65 72 54 | 61 62 6c 65 3b 0d 09 69 |HandlerT|able;..i|
|00000a10| 66 20 28 68 54 61 62 6c | 65 20 21 3d 20 6e 69 6c |f (hTabl|e != nil|
|00000a20| 29 0d 09 7b 0d 09 09 6e | 45 6e 74 72 69 65 73 20 |)..{...n|Entries |
|00000a30| 3d 20 47 65 74 48 61 6e | 64 6c 65 53 69 7a 65 28 |= GetHan|dleSize(|
|00000a40| 28 48 61 6e 64 6c 65 29 | 20 68 54 61 62 6c 65 29 |(Handle)| hTable)|
|00000a50| 20 2f 20 73 69 7a 65 6f | 66 28 57 45 4f 48 54 61 | / sizeo|f(WEOHTa|
|00000a60| 62 6c 65 45 6e 74 72 79 | 29 3b 0d 09 7d 0d 0d 09 |bleEntry|);..}...|
|00000a70| 2f 2f 20 72 65 74 75 72 | 6e 20 61 6e 20 65 72 72 |// retur|n an err|
|00000a80| 6f 72 20 63 6f 64 65 20 | 69 66 20 69 6e 64 65 78 |or code |if index|
|00000a90| 20 69 73 20 74 6f 6f 20 | 6c 61 72 67 65 0d 09 69 | is too |large..i|
|00000aa0| 66 20 28 69 6e 64 65 78 | 20 3e 3d 20 6e 45 6e 74 |f (index| >= nEnt|
|00000ab0| 72 69 65 73 29 0d 09 7b | 0d 09 09 72 65 74 75 72 |ries)..{|...retur|
|00000ac0| 6e 20 77 65 55 6e 6b 6e | 6f 77 6e 4f 62 6a 65 63 |n weUnkn|ownObjec|
|00000ad0| 74 54 79 70 65 45 72 72 | 3b 0d 09 7d 0d 0d 09 2a |tTypeErr|;..}...*|
|00000ae0| 6f 62 6a 65 63 74 54 79 | 70 65 20 3d 20 28 2a 68 |objectTy|pe = (*h|
|00000af0| 54 61 62 6c 65 29 5b 69 | 6e 64 65 78 5d 2e 6f 62 |Table)[i|ndex].ob|
|00000b00| 6a 65 63 74 54 79 70 65 | 3b 0d 0d 09 72 65 74 75 |jectType|;...retu|
|00000b10| 72 6e 20 6e 6f 45 72 72 | 3b 0d 7d 0d 0d 70 61 73 |rn noErr|;.}..pas|
|00000b20| 63 61 6c 20 4f 53 45 72 | 72 20 5f 57 45 4e 65 77 |cal OSEr|r _WENew|
|00000b30| 4f 62 6a 65 63 74 28 46 | 6c 61 76 6f 72 54 79 70 |Object(F|lavorTyp|
|00000b40| 65 20 6f 62 6a 65 63 74 | 54 79 70 65 2c 20 48 61 |e object|Type, Ha|
|00000b50| 6e 64 6c 65 20 6f 62 6a | 65 63 74 44 61 74 61 48 |ndle obj|ectDataH|
|00000b60| 61 6e 64 6c 65 2c 20 57 | 45 48 61 6e 64 6c 65 20 |andle, W|EHandle |
|00000b70| 68 57 45 2c 0d 09 09 09 | 09 09 57 45 4f 62 6a 65 |hWE,....|..WEObje|
|00000b80| 63 74 44 65 73 63 48 61 | 6e 64 6c 65 20 2a 68 4f |ctDescHa|ndle *hO|
|00000b90| 62 6a 65 63 74 44 65 73 | 63 29 0d 7b 0d 09 57 45 |bjectDes|c).{..WE|
|00000ba0| 4f 62 6a 65 63 74 44 65 | 73 63 20 2a 70 44 65 73 |ObjectDe|sc *pDes|
|00000bb0| 63 3b 0d 09 57 45 4f 48 | 54 61 62 6c 65 48 61 6e |c;..WEOH|TableHan|
|00000bc0| 64 6c 65 20 68 54 61 62 | 6c 65 3b 0d 09 53 49 6e |dle hTab|le;..SIn|
|00000bd0| 74 33 32 20 69 6e 64 65 | 78 3b 0d 09 4f 53 45 72 |t32 inde|x;..OSEr|
|00000be0| 72 20 65 72 72 3b 0d 0d | 09 2a 68 4f 62 6a 65 63 |r err;..|.*hObjec|
|00000bf0| 74 44 65 73 63 20 3d 20 | 6e 69 6c 3b 0d 0d 09 2f |tDesc = |nil;.../|
|00000c00| 2f 20 66 69 72 73 74 20 | 6c 6f 6f 6b 20 75 70 20 |/ first |look up |
|00000c10| 74 68 65 20 73 70 65 63 | 69 66 69 65 64 20 6f 62 |the spec|ified ob|
|00000c20| 6a 65 63 74 20 74 79 70 | 65 20 69 6e 20 74 68 65 |ject typ|e in the|
|00000c30| 20 69 6e 73 74 61 6e 63 | 65 2d 73 70 65 63 69 66 | instanc|e-specif|
|00000c40| 69 63 20 68 61 6e 64 6c | 65 72 20 74 61 62 6c 65 |ic handl|er table|
|00000c50| 0d 09 68 54 61 62 6c 65 | 20 3d 20 28 2a 68 57 45 |..hTable| = (*hWE|
|00000c60| 29 2d 3e 68 4f 62 6a 65 | 63 74 48 61 6e 64 6c 65 |)->hObje|ctHandle|
|00000c70| 72 54 61 62 6c 65 3b 0d | 09 69 66 20 28 28 69 6e |rTable;.|.if ((in|
|00000c80| 64 65 78 20 3d 20 5f 57 | 45 4c 6f 6f 6b 75 70 4f |dex = _W|ELookupO|
|00000c90| 62 6a 65 63 74 54 79 70 | 65 28 6f 62 6a 65 63 74 |bjectTyp|e(object|
|00000ca0| 54 79 70 65 2c 20 68 54 | 61 62 6c 65 29 29 20 3d |Type, hT|able)) =|
|00000cb0| 3d 20 6b 55 6e 6b 6e 6f | 77 6e 4f 62 6a 65 63 74 |= kUnkno|wnObject|
|00000cc0| 54 79 70 65 29 0d 09 7b | 0d 09 09 2f 2f 20 6e 6f |Type)..{|...// no|
|00000cd0| 20 6d 61 74 63 68 3a 20 | 74 72 79 20 77 69 74 68 | match: |try with|
|00000ce0| 20 74 68 65 20 67 6c 6f | 62 61 6c 20 68 61 6e 64 | the glo|bal hand|
|00000cf0| 6c 65 72 20 74 61 62 6c | 65 0d 09 09 68 54 61 62 |ler tabl|e...hTab|
|00000d00| 6c 65 20 3d 20 5f 77 65 | 47 6c 6f 62 61 6c 4f 62 |le = _we|GlobalOb|
|00000d10| 6a 65 63 74 48 61 6e 64 | 6c 65 72 54 61 62 6c 65 |jectHand|lerTable|
|00000d20| 3b 0d 09 09 69 66 20 28 | 28 69 6e 64 65 78 20 3d |;...if (|(index =|
|00000d30| 20 5f 57 45 4c 6f 6f 6b | 75 70 4f 62 6a 65 63 74 | _WELook|upObject|
|00000d40| 54 79 70 65 28 6f 62 6a | 65 63 74 54 79 70 65 2c |Type(obj|ectType,|
|00000d50| 20 68 54 61 62 6c 65 29 | 29 20 3d 3d 20 6b 55 6e | hTable)|) == kUn|
|00000d60| 6b 6e 6f 77 6e 4f 62 6a | 65 63 74 54 79 70 65 29 |knownObj|ectType)|
|00000d70| 0d 09 09 7b 0d 09 09 09 | 68 54 61 62 6c 65 20 3d |...{....|hTable =|
|00000d80| 20 6e 69 6c 3b 0d 09 09 | 7d 0d 09 7d 0d 0d 09 2f | nil;...|}..}.../|
|00000d90| 2f 20 63 72 65 61 74 65 | 20 61 20 6e 65 77 20 72 |/ create| a new r|
|00000da0| 65 6c 6f 63 61 74 61 62 | 6c 65 20 62 6c 6f 63 6b |elocatab|le block|
|00000db0| 20 74 6f 20 68 6f 6c 64 | 20 74 68 65 20 6f 62 6a | to hold| the obj|
|00000dc0| 65 63 74 20 64 65 73 63 | 72 69 70 74 6f 72 0d 09 |ect desc|riptor..|
|00000dd0| 69 66 20 28 28 65 72 72 | 20 3d 20 5f 57 45 41 6c |if ((err| = _WEAl|
|00000de0| 6c 6f 63 61 74 65 28 73 | 69 7a 65 6f 66 28 57 45 |locate(s|izeof(WE|
|00000df0| 4f 62 6a 65 63 74 44 65 | 73 63 29 2c 20 6b 41 6c |ObjectDe|sc), kAl|
|00000e00| 6c 6f 63 43 6c 65 61 72 | 2c 20 28 48 61 6e 64 6c |locClear|, (Handl|
|00000e10| 65 20 2a 29 68 4f 62 6a | 65 63 74 44 65 73 63 29 |e *)hObj|ectDesc)|
|00000e20| 29 20 21 3d 20 6e 6f 45 | 72 72 29 0d 09 7b 0d 09 |) != noE|rr)..{..|
|00000e30| 09 72 65 74 75 72 6e 20 | 65 72 72 3b 0d 09 7d 0d |.return |err;..}.|
|00000e40| 0d 09 2f 2f 20 6c 6f 63 | 6b 20 69 74 20 64 6f 77 |..// loc|k it dow|
|00000e50| 6e 0d 09 48 4c 6f 63 6b | 28 28 48 61 6e 64 6c 65 |n..HLock|((Handle|
|00000e60| 29 20 2a 68 4f 62 6a 65 | 63 74 44 65 73 63 29 3b |) *hObje|ctDesc);|
|00000e70| 0d 09 70 44 65 73 63 20 | 3d 20 28 57 45 4f 62 6a |..pDesc |= (WEObj|
|00000e80| 65 63 74 44 65 73 63 20 | 2a 29 20 2a 2a 68 4f 62 |ectDesc |*) **hOb|
|00000e90| 6a 65 63 74 44 65 73 63 | 3b 0d 0d 09 2f 2f 20 66 |jectDesc|;...// f|
|00000ea0| 69 6c 6c 20 69 6e 20 74 | 68 65 20 6f 62 6a 65 63 |ill in t|he objec|
|00000eb0| 74 20 64 65 73 63 72 69 | 70 74 6f 72 0d 09 70 44 |t descri|ptor..pD|
|00000ec0| 65 73 63 2d 3e 6f 62 6a | 65 63 74 54 79 70 65 20 |esc->obj|ectType |
|00000ed0| 3d 20 6f 62 6a 65 63 74 | 54 79 70 65 3b 0d 09 70 |= object|Type;..p|
|00000ee0| 44 65 73 63 2d 3e 6f 62 | 6a 65 63 74 44 61 74 61 |Desc->ob|jectData|
|00000ef0| 48 61 6e 64 6c 65 20 3d | 20 6f 62 6a 65 63 74 44 |Handle =| objectD|
|00000f00| 61 74 61 48 61 6e 64 6c | 65 3b 0d 09 70 44 65 73 |ataHandl|e;..pDes|
|00000f10| 63 2d 3e 6f 62 6a 65 63 | 74 53 69 7a 65 2e 76 20 |c->objec|tSize.v |
|00000f20| 3d 20 6b 44 65 66 61 75 | 6c 74 4f 62 6a 65 63 74 |= kDefau|ltObject|
|00000f30| 48 65 69 67 68 74 3b 0d | 09 70 44 65 73 63 2d 3e |Height;.|.pDesc->|
|00000f40| 6f 62 6a 65 63 74 53 69 | 7a 65 2e 68 20 3d 20 6b |objectSi|ze.h = k|
|00000f50| 44 65 66 61 75 6c 74 4f | 62 6a 65 63 74 57 69 64 |DefaultO|bjectWid|
|00000f60| 74 68 3b 0d 09 70 44 65 | 73 63 2d 3e 6f 62 6a 65 |th;..pDe|sc->obje|
|00000f70| 63 74 54 61 62 6c 65 20 | 3d 20 68 54 61 62 6c 65 |ctTable |= hTable|
|00000f80| 3b 0d 09 70 44 65 73 63 | 2d 3e 6f 62 6a 65 63 74 |;..pDesc|->object|
|00000f90| 49 6e 64 65 78 20 3d 20 | 69 6e 64 65 78 3b 0d 09 |Index = |index;..|
|00000fa0| 70 44 65 73 63 2d 3e 6f | 62 6a 65 63 74 4f 77 6e |pDesc->o|bjectOwn|
|00000fb0| 65 72 20 3d 20 68 57 45 | 3b 0d 0d 09 69 66 20 28 |er = hWE|;...if (|
|00000fc0| 68 54 61 62 6c 65 20 21 | 3d 20 6e 69 6c 29 0d 09 |hTable !|= nil)..|
|00000fd0| 7b 0d 09 09 57 45 4e 65 | 77 4f 62 6a 65 63 74 55 |{...WENe|wObjectU|
|00000fe0| 50 50 20 6e 65 77 48 61 | 6e 64 6c 65 72 20 3d 20 |PP newHa|ndler = |
|00000ff0| 28 2a 68 54 61 62 6c 65 | 29 5b 69 6e 64 65 78 5d |(*hTable|)[index]|
|00001000| 2e 6e 65 77 48 61 6e 64 | 6c 65 72 3b 0d 09 09 70 |.newHand|ler;...p|
|00001010| 44 65 73 63 2d 3e 6f 62 | 6a 65 63 74 52 65 66 43 |Desc->ob|jectRefC|
|00001020| 6f 6e 20 3d 20 28 2a 68 | 54 61 62 6c 65 29 5b 69 |on = (*h|Table)[i|
|00001030| 6e 64 65 78 5d 2e 72 65 | 66 43 6f 6e 3b 0d 0d 09 |ndex].re|fCon;...|
|00001040| 09 2f 2f 20 63 61 6c 6c | 20 74 68 65 20 6e 65 77 |.// call| the new|
|00001050| 20 68 61 6e 64 6c 65 72 | 2c 20 69 66 20 61 6e 79 | handler|, if any|
|00001060| 0d 09 09 69 66 20 28 6e | 65 77 48 61 6e 64 6c 65 |...if (n|ewHandle|
|00001070| 72 20 21 3d 20 6e 69 6c | 29 0d 09 09 7b 0d 09 09 |r != nil|)...{...|
|00001080| 09 69 66 20 28 28 65 72 | 72 20 3d 20 43 61 6c 6c |.if ((er|r = Call|
|00001090| 57 45 4e 65 77 4f 62 6a | 65 63 74 50 72 6f 63 28 |WENewObj|ectProc(|
|000010a0| 26 70 44 65 73 63 2d 3e | 6f 62 6a 65 63 74 53 69 |&pDesc->|objectSi|
|000010b0| 7a 65 2c 20 2a 68 4f 62 | 6a 65 63 74 44 65 73 63 |ze, *hOb|jectDesc|
|000010c0| 2c 20 6e 65 77 48 61 6e | 64 6c 65 72 29 29 20 21 |, newHan|dler)) !|
|000010d0| 3d 20 6e 6f 45 72 72 29 | 0d 09 09 09 7b 0d 09 09 |= noErr)|....{...|
|000010e0| 09 09 5f 57 45 46 6f 72 | 67 65 74 48 61 6e 64 6c |.._WEFor|getHandl|
|000010f0| 65 28 28 48 61 6e 64 6c | 65 20 2a 29 20 68 4f 62 |e((Handl|e *) hOb|
|00001100| 6a 65 63 74 44 65 73 63 | 29 3b 0d 09 09 09 09 72 |jectDesc|);.....r|
|00001110| 65 74 75 72 6e 20 65 72 | 72 3b 0d 09 09 09 7d 0d |eturn er|r;....}.|
|00001120| 09 09 7d 0d 09 7d 0d 0d | 09 2f 2f 20 75 6e 6c 6f |..}..}..|.// unlo|
|00001130| 63 6b 20 74 68 65 20 6f | 62 6a 65 63 74 20 64 65 |ck the o|bject de|
|00001140| 73 63 72 69 70 74 6f 72 | 0d 09 48 55 6e 6c 6f 63 |scriptor|..HUnloc|
|00001150| 6b 28 28 48 61 6e 64 6c | 65 29 20 2a 68 4f 62 6a |k((Handl|e) *hObj|
|00001160| 65 63 74 44 65 73 63 29 | 3b 0d 0d 09 2f 2f 20 63 |ectDesc)|;...// c|
|00001170| 6c 65 61 72 20 72 65 73 | 75 6c 74 20 63 6f 64 65 |lear res|ult code|
|00001180| 0d 09 72 65 74 75 72 6e | 20 6e 6f 45 72 72 3b 0d |..return| noErr;.|
|00001190| 7d 0d 0d 70 61 73 63 61 | 6c 20 4f 53 45 72 72 20 |}..pasca|l OSErr |
|000011a0| 5f 57 45 46 72 65 65 4f | 62 6a 65 63 74 28 57 45 |_WEFreeO|bject(WE|
|000011b0| 4f 62 6a 65 63 74 44 65 | 73 63 48 61 6e 64 6c 65 |ObjectDe|scHandle|
|000011c0| 20 68 4f 62 6a 65 63 74 | 44 65 73 63 29 0d 7b 0d | hObject|Desc).{.|
|000011d0| 09 57 45 4f 62 6a 65 63 | 74 44 65 73 63 20 2a 70 |.WEObjec|tDesc *p|
|000011e0| 44 65 73 63 3b 0d 09 4f | 53 45 72 72 20 65 72 72 |Desc;..O|SErr err|
|000011f0| 20 3d 20 6e 6f 45 72 72 | 3b 0d 0d 09 2f 2f 20 73 | = noErr|;...// s|
|00001200| 61 6e 69 74 79 20 63 68 | 65 63 6b 3a 20 64 6f 20 |anity ch|eck: do |
|00001210| 6e 6f 74 68 69 6e 67 20 | 69 66 20 77 65 20 68 61 |nothing |if we ha|
|00001220| 76 65 20 61 20 6e 75 6c | 6c 20 64 65 73 63 72 69 |ve a nul|l descri|
|00001230| 70 74 6f 72 20 68 61 6e | 64 6c 65 0d 09 69 66 20 |ptor han|dle..if |
|00001240| 28 68 4f 62 6a 65 63 74 | 44 65 73 63 20 3d 3d 20 |(hObject|Desc == |
|00001250| 6e 69 6c 29 0d 09 7b 0d | 09 09 72 65 74 75 72 6e |nil)..{.|..return|
|00001260| 20 6e 69 6c 48 61 6e 64 | 6c 65 45 72 72 3b 0d 09 | nilHand|leErr;..|
|00001270| 7d 0d 0d 09 2f 2f 20 6c | 6f 63 6b 20 74 68 65 20 |}...// l|ock the |
|00001280| 64 65 73 63 72 69 70 74 | 6f 72 20 72 65 63 6f 72 |descript|or recor|
|00001290| 64 0d 09 48 4c 6f 63 6b | 28 28 48 61 6e 64 6c 65 |d..HLock|((Handle|
|000012a0| 29 68 4f 62 6a 65 63 74 | 44 65 73 63 29 3b 0d 09 |)hObject|Desc);..|
|000012b0| 70 44 65 73 63 20 3d 20 | 2a 68 4f 62 6a 65 63 74 |pDesc = |*hObject|
|000012c0| 44 65 73 63 3b 0d 0d 09 | 69 66 20 28 70 44 65 73 |Desc;...|if (pDes|
|000012d0| 63 2d 3e 6f 62 6a 65 63 | 74 54 61 62 6c 65 20 21 |c->objec|tTable !|
|000012e0| 3d 20 6e 69 6c 29 0d 09 | 7b 0d 09 09 57 45 44 69 |= nil)..|{...WEDi|
|000012f0| 73 70 6f 73 65 4f 62 6a | 65 63 74 55 50 50 20 66 |sposeObj|ectUPP f|
|00001300| 72 65 65 48 61 6e 64 6c | 65 72 20 3d 20 28 2a 70 |reeHandl|er = (*p|
|00001310| 44 65 73 63 2d 3e 6f 62 | 6a 65 63 74 54 61 62 6c |Desc->ob|jectTabl|
|00001320| 65 29 5b 70 44 65 73 63 | 2d 3e 6f 62 6a 65 63 74 |e)[pDesc|->object|
|00001330| 49 6e 64 65 78 5d 2e 66 | 72 65 65 48 61 6e 64 6c |Index].f|reeHandl|
|00001340| 65 72 3b 0d 0d 09 09 2f | 2f 20 63 61 6c 6c 20 74 |er;..../|/ call t|
|00001350| 68 65 20 64 69 73 70 6f | 73 65 20 68 61 6e 64 6c |he dispo|se handl|
|00001360| 65 72 2c 20 69 66 20 61 | 6e 79 0d 09 09 69 66 20 |er, if a|ny...if |
|00001370| 28 66 72 65 65 48 61 6e | 64 6c 65 72 20 21 3d 20 |(freeHan|dler != |
|00001380| 6e 69 6c 29 0d 09 09 7b | 0d 09 09 09 65 72 72 20 |nil)...{|....err |
|00001390| 3d 20 43 61 6c 6c 57 45 | 44 69 73 70 6f 73 65 4f |= CallWE|DisposeO|
|000013a0| 62 6a 65 63 74 50 72 6f | 63 28 68 4f 62 6a 65 63 |bjectPro|c(hObjec|
|000013b0| 74 44 65 73 63 2c 20 66 | 72 65 65 48 61 6e 64 6c |tDesc, f|reeHandl|
|000013c0| 65 72 29 3b 0d 09 09 09 | 70 44 65 73 63 2d 3e 6f |er);....|pDesc->o|
|000013d0| 62 6a 65 63 74 44 61 74 | 61 48 61 6e 64 6c 65 20 |bjectDat|aHandle |
|000013e0| 3d 20 6e 69 6c 3b 0d 09 | 09 7d 0d 09 7d 0d 0d 09 |= nil;..|.}..}...|
|000013f0| 2f 2f 20 69 66 20 6f 62 | 6a 65 63 74 20 6b 69 6e |// if ob|ject kin|
|00001400| 64 20 69 73 20 75 6e 6b | 6e 6f 77 6e 20 6f 72 20 |d is unk|nown or |
|00001410| 74 68 65 72 65 27 73 20 | 6e 6f 20 63 75 73 74 6f |there's |no custo|
|00001420| 6d 20 64 69 73 70 6f 73 | 65 20 68 61 6e 64 6c 65 |m dispos|e handle|
|00001430| 72 2c 20 75 73 65 20 44 | 69 73 70 6f 73 65 48 61 |r, use D|isposeHa|
|00001440| 6e 64 6c 65 0d 09 5f 57 | 45 46 6f 72 67 65 74 48 |ndle.._W|EForgetH|
|00001450| 61 6e 64 6c 65 28 26 70 | 44 65 73 63 2d 3e 6f 62 |andle(&p|Desc->ob|
|00001460| 6a 65 63 74 44 61 74 61 | 48 61 6e 64 6c 65 29 3b |jectData|Handle);|
|00001470| 0d 0d 09 2f 2f 20 66 69 | 6e 61 6c 6c 79 2c 20 64 |...// fi|nally, d|
|00001480| 69 73 70 6f 73 65 20 6f | 66 20 74 68 65 20 6f 62 |ispose o|f the ob|
|00001490| 6a 65 63 74 20 64 65 73 | 63 72 69 70 74 6f 72 20 |ject des|criptor |
|000014a0| 69 74 73 65 6c 66 0d 09 | 44 69 73 70 6f 73 65 48 |itself..|DisposeH|
|000014b0| 61 6e 64 6c 65 28 28 48 | 61 6e 64 6c 65 29 68 4f |andle((H|andle)hO|
|000014c0| 62 6a 65 63 74 44 65 73 | 63 29 3b 0d 0d 09 72 65 |bjectDes|c);...re|
|000014d0| 74 75 72 6e 20 65 72 72 | 3b 0d 7d 0d 0d 70 61 73 |turn err|;.}..pas|
|000014e0| 63 61 6c 20 4f 53 45 72 | 72 20 5f 57 45 44 72 61 |cal OSEr|r _WEDra|
|000014f0| 77 4f 62 6a 65 63 74 28 | 57 45 4f 62 6a 65 63 74 |wObject(|WEObject|
|00001500| 44 65 73 63 48 61 6e 64 | 6c 65 20 68 4f 62 6a 65 |DescHand|le hObje|
|00001510| 63 74 44 65 73 63 29 0d | 7b 0d 09 57 45 4f 62 6a |ctDesc).|{..WEObj|
|00001520| 65 63 74 44 65 73 63 20 | 2a 70 44 65 73 63 3b 0d |ectDesc |*pDesc;.|
|00001530| 09 52 65 63 74 20 64 65 | 73 74 52 65 63 74 3b 0d |.Rect de|stRect;.|
|00001540| 09 50 65 6e 53 74 61 74 | 65 20 73 74 61 74 65 3b |.PenStat|e state;|
|00001550| 0d 09 42 6f 6f 6c 65 61 | 6e 20 73 61 76 65 44 65 |..Boolea|n saveDe|
|00001560| 73 63 4c 6f 63 6b 3b 0d | 09 4f 53 45 72 72 20 65 |scLock;.|.OSErr e|
|00001570| 72 72 20 3d 20 6e 6f 45 | 72 72 3b 0d 0d 09 2f 2f |rr = noE|rr;...//|
|00001580| 20 6c 6f 63 6b 20 74 68 | 65 20 6f 62 6a 65 63 74 | lock th|e object|
|00001590| 20 64 65 73 63 72 69 70 | 74 6f 72 0d 09 73 61 76 | descrip|tor..sav|
|000015a0| 65 44 65 73 63 4c 6f 63 | 6b 20 3d 20 5f 57 45 53 |eDescLoc|k = _WES|
|000015b0| 65 74 48 61 6e 64 6c 65 | 4c 6f 63 6b 28 28 48 61 |etHandle|Lock((Ha|
|000015c0| 6e 64 6c 65 29 68 4f 62 | 6a 65 63 74 44 65 73 63 |ndle)hOb|jectDesc|
|000015d0| 2c 20 74 72 75 65 29 3b | 0d 09 70 44 65 73 63 20 |, true);|..pDesc |
|000015e0| 3d 20 2a 68 4f 62 6a 65 | 63 74 44 65 73 63 3b 0d |= *hObje|ctDesc;.|
|000015f0| 0d 09 2f 2f 20 67 65 74 | 20 63 75 72 72 65 6e 74 |..// get| current|
|00001600| 20 70 65 6e 20 73 74 61 | 74 65 0d 09 2f 2f 20 73 | pen sta|te..// s|
|00001610| 74 61 74 65 2e 70 6e 4c | 6f 63 20 68 61 73 20 61 |tate.pnL|oc has a|
|00001620| 6c 72 65 61 64 79 20 62 | 65 65 6e 20 73 65 74 20 |lready b|een set |
|00001630| 74 6f 20 74 68 65 20 62 | 6f 74 74 6f 6d 20 6c 65 |to the b|ottom le|
|00001640| 66 74 20 6f 66 20 74 68 | 65 20 72 65 63 74 61 6e |ft of th|e rectan|
|00001650| 67 6c 65 20 74 6f 20 64 | 72 61 77 0d 09 47 65 74 |gle to d|raw..Get|
|00001660| 50 65 6e 53 74 61 74 65 | 28 26 73 74 61 74 65 29 |PenState|(&state)|
|00001670| 3b 0d 0d 09 2f 2f 20 63 | 61 6c 63 75 6c 61 74 65 |;...// c|alculate|
|00001680| 20 74 68 65 20 6e 65 77 | 20 70 65 6e 20 70 6f 73 | the new| pen pos|
|00001690| 69 74 69 6f 6e 0d 09 73 | 74 61 74 65 2e 70 6e 4c |ition..s|tate.pnL|
|000016a0| 6f 63 2e 68 20 2b 3d 20 | 70 44 65 73 63 2d 3e 6f |oc.h += |pDesc->o|
|000016b0| 62 6a 65 63 74 53 69 7a | 65 2e 68 3b 0d 0d 09 2f |bjectSiz|e.h;.../|
|000016c0| 2f 20 63 61 6c 63 75 6c | 61 74 65 20 74 68 65 20 |/ calcul|ate the |
|000016d0| 64 65 73 74 69 6e 61 74 | 69 6f 6e 20 72 65 63 74 |destinat|ion rect|
|000016e0| 61 6e 67 6c 65 0d 09 2a | 20 28 53 49 6e 74 33 32 |angle..*| (SInt32|
|000016f0| 20 2a 29 20 28 26 74 6f | 70 4c 65 66 74 28 64 65 | *) (&to|pLeft(de|
|00001700| 73 74 52 65 63 74 29 29 | 20 3d 20 44 65 6c 74 61 |stRect))| = Delta|
|00001710| 50 6f 69 6e 74 28 73 74 | 61 74 65 2e 70 6e 4c 6f |Point(st|ate.pnLo|
|00001720| 63 2c 20 70 44 65 73 63 | 2d 3e 6f 62 6a 65 63 74 |c, pDesc|->object|
|00001730| 53 69 7a 65 29 3b 0d 09 | 62 6f 74 52 69 67 68 74 |Size);..|botRight|
|00001740| 28 64 65 73 74 52 65 63 | 74 29 20 3d 20 73 74 61 |(destRec|t) = sta|
|00001750| 74 65 2e 70 6e 4c 6f 63 | 3b 0d 0d 09 69 66 20 28 |te.pnLoc|;...if (|
|00001760| 70 44 65 73 63 2d 3e 6f | 62 6a 65 63 74 54 61 62 |pDesc->o|bjectTab|
|00001770| 6c 65 20 21 3d 20 6e 69 | 6c 29 0d 09 7b 0d 09 09 |le != ni|l)..{...|
|00001780| 57 45 44 72 61 77 4f 62 | 6a 65 63 74 55 50 50 20 |WEDrawOb|jectUPP |
|00001790| 64 72 61 77 48 61 6e 64 | 6c 65 72 20 3d 20 28 2a |drawHand|ler = (*|
|000017a0| 70 44 65 73 63 2d 3e 6f | 62 6a 65 63 74 54 61 62 |pDesc->o|bjectTab|
|000017b0| 6c 65 29 5b 70 44 65 73 | 63 2d 3e 6f 62 6a 65 63 |le)[pDes|c->objec|
|000017c0| 74 49 6e 64 65 78 5d 2e | 64 72 61 77 48 61 6e 64 |tIndex].|drawHand|
|000017d0| 6c 65 72 3b 0d 0d 09 09 | 2f 2f 20 63 61 6c 6c 20 |ler;....|// call |
|000017e0| 74 68 65 20 64 72 61 77 | 69 6e 67 20 68 61 6e 64 |the draw|ing hand|
|000017f0| 6c 65 72 2c 20 69 66 20 | 61 6e 79 0d 09 09 69 66 |ler, if |any...if|
|00001800| 20 28 64 72 61 77 48 61 | 6e 64 6c 65 72 20 21 3d | (drawHa|ndler !=|
|00001810| 20 6e 69 6c 29 0d 09 09 | 7b 0d 09 09 09 65 72 72 | nil)...|{....err|
|00001820| 20 3d 20 43 61 6c 6c 57 | 45 44 72 61 77 4f 62 6a | = CallW|EDrawObj|
|00001830| 65 63 74 50 72 6f 63 28 | 26 64 65 73 74 52 65 63 |ectProc(|&destRec|
|00001840| 74 2c 20 68 4f 62 6a 65 | 63 74 44 65 73 63 2c 20 |t, hObje|ctDesc, |
|00001850| 64 72 61 77 48 61 6e 64 | 6c 65 72 29 3b 0d 09 09 |drawHand|ler);...|
|00001860| 7d 0d 09 7d 0d 09 65 6c | 73 65 0d 09 7b 0d 09 09 |}..}..el|se..{...|
|00001870| 2f 2f 20 69 66 20 74 68 | 69 73 20 6f 62 6a 65 63 |// if th|is objec|
|00001880| 74 20 6b 69 6e 64 20 77 | 61 73 20 6e 6f 74 20 72 |t kind w|as not r|
|00001890| 65 67 69 73 74 65 72 65 | 64 2c 20 64 72 61 77 20 |egistere|d, draw |
|000018a0| 61 6e 20 65 6d 70 74 79 | 20 66 72 61 6d 65 0d 09 |an empty| frame..|
|000018b0| 09 50 65 6e 4e 6f 72 6d | 61 6c 28 29 3b 0d 09 09 |.PenNorm|al();...|
|000018c0| 46 72 61 6d 65 52 65 63 | 74 28 26 64 65 73 74 52 |FrameRec|t(&destR|
|000018d0| 65 63 74 29 3b 0d 09 7d | 0d 0d 09 2f 2f 20 72 65 |ect);..}|...// re|
|000018e0| 73 74 6f 72 65 20 6f 72 | 69 67 69 6e 61 6c 20 70 |store or|iginal p|
|000018f0| 65 6e 20 73 74 61 74 65 | 2c 20 61 64 76 61 6e 63 |en state|, advanc|
|00001900| 69 6e 67 20 74 68 65 20 | 70 65 6e 20 70 6f 73 69 |ing the |pen posi|
|00001910| 74 69 6f 6e 20 62 79 20 | 74 68 65 20 6f 62 6a 65 |tion by |the obje|
|00001920| 63 74 20 77 69 64 74 68 | 0d 09 53 65 74 50 65 6e |ct width|..SetPen|
|00001930| 53 74 61 74 65 28 26 73 | 74 61 74 65 29 3b 0d 0d |State(&s|tate);..|
|00001940| 09 2f 2f 20 75 6e 6c 6f | 63 6b 20 74 68 65 20 6f |.// unlo|ck the o|
|00001950| 62 6a 65 63 74 20 64 65 | 73 63 72 69 70 74 6f 72 |bject de|scriptor|
|00001960| 0d 09 5f 57 45 53 65 74 | 48 61 6e 64 6c 65 4c 6f |.._WESet|HandleLo|
|00001970| 63 6b 28 28 48 61 6e 64 | 6c 65 29 68 4f 62 6a 65 |ck((Hand|le)hObje|
|00001980| 63 74 44 65 73 63 2c 20 | 73 61 76 65 44 65 73 63 |ctDesc, |saveDesc|
|00001990| 4c 6f 63 6b 29 3b 0d 0d | 09 72 65 74 75 72 6e 20 |Lock);..|.return |
|000019a0| 65 72 72 3b 0d 7d 0d 0d | 70 61 73 63 61 6c 20 42 |err;.}..|pascal B|
|000019b0| 6f 6f 6c 65 61 6e 20 5f | 57 45 43 6c 69 63 6b 4f |oolean _|WEClickO|
|000019c0| 62 6a 65 63 74 28 50 6f | 69 6e 74 20 68 69 74 50 |bject(Po|int hitP|
|000019d0| 74 2c 20 45 76 65 6e 74 | 4d 6f 64 69 66 69 65 72 |t, Event|Modifier|
|000019e0| 73 20 6d 6f 64 69 66 69 | 65 72 73 2c 20 55 49 6e |s modifi|ers, UIn|
|000019f0| 74 33 32 20 63 6c 69 63 | 6b 54 69 6d 65 2c 0d 09 |t32 clic|kTime,..|
|00001a00| 09 09 09 09 09 09 09 57 | 45 4f 62 6a 65 63 74 44 |.......W|EObjectD|
|00001a10| 65 73 63 48 61 6e 64 6c | 65 20 68 4f 62 6a 65 63 |escHandl|e hObjec|
|00001a20| 74 44 65 73 63 29 0d 7b | 0d 09 57 45 4f 62 6a 65 |tDesc).{|..WEObje|
|00001a30| 63 74 44 65 73 63 20 2a | 70 44 65 73 63 3b 0d 09 |ctDesc *|pDesc;..|
|00001a40| 42 6f 6f 6c 65 61 6e 20 | 73 61 76 65 44 65 73 63 |Boolean |saveDesc|
|00001a50| 4c 6f 63 6b 3b 0d 09 42 | 6f 6f 6c 65 61 6e 20 63 |Lock;..B|oolean c|
|00001a60| 6c 69 63 6b 48 61 6e 64 | 6c 65 64 20 3d 20 66 61 |lickHand|led = fa|
|00001a70| 6c 73 65 3b 0d 0d 09 2f | 2f 20 6c 6f 63 6b 20 74 |lse;.../|/ lock t|
|00001a80| 68 65 20 6f 62 6a 65 63 | 74 20 64 65 73 63 72 69 |he objec|t descri|
|00001a90| 70 74 6f 72 0d 09 73 61 | 76 65 44 65 73 63 4c 6f |ptor..sa|veDescLo|
|00001aa0| 63 6b 20 3d 20 5f 57 45 | 53 65 74 48 61 6e 64 6c |ck = _WE|SetHandl|
|00001ab0| 65 4c 6f 63 6b 28 28 48 | 61 6e 64 6c 65 29 68 4f |eLock((H|andle)hO|
|00001ac0| 62 6a 65 63 74 44 65 73 | 63 2c 20 74 72 75 65 29 |bjectDes|c, true)|
|00001ad0| 3b 0d 09 70 44 65 73 63 | 20 3d 20 2a 68 4f 62 6a |;..pDesc| = *hObj|
|00001ae0| 65 63 74 44 65 73 63 3b | 0d 0d 09 69 66 20 28 70 |ectDesc;|...if (p|
|00001af0| 44 65 73 63 2d 3e 6f 62 | 6a 65 63 74 54 61 62 6c |Desc->ob|jectTabl|
|00001b00| 65 20 21 3d 20 6e 69 6c | 29 0d 09 7b 0d 09 09 57 |e != nil|)..{...W|
|00001b10| 45 43 6c 69 63 6b 4f 62 | 6a 65 63 74 55 50 50 20 |EClickOb|jectUPP |
|00001b20| 63 6c 69 63 6b 48 61 6e | 64 6c 65 72 20 3d 20 28 |clickHan|dler = (|
|00001b30| 2a 70 44 65 73 63 2d 3e | 6f 62 6a 65 63 74 54 61 |*pDesc->|objectTa|
|00001b40| 62 6c 65 29 5b 70 44 65 | 73 63 2d 3e 6f 62 6a 65 |ble)[pDe|sc->obje|
|00001b50| 63 74 49 6e 64 65 78 5d | 2e 63 6c 69 63 6b 48 61 |ctIndex]|.clickHa|
|00001b60| 6e 64 6c 65 72 3b 0d 0d | 09 09 2f 2f 20 63 61 6c |ndler;..|..// cal|
|00001b70| 6c 20 74 68 65 20 63 6c | 69 63 6b 20 68 61 6e 64 |l the cl|ick hand|
|00001b80| 6c 65 72 2c 20 69 66 20 | 61 6e 79 0d 09 09 69 66 |ler, if |any...if|
|00001b90| 20 28 63 6c 69 63 6b 48 | 61 6e 64 6c 65 72 20 21 | (clickH|andler !|
|00001ba0| 3d 20 6e 69 6c 29 0d 09 | 09 7b 0d 09 09 09 63 6c |= nil)..|.{....cl|
|00001bb0| 69 63 6b 48 61 6e 64 6c | 65 64 20 3d 20 43 61 6c |ickHandl|ed = Cal|
|00001bc0| 6c 57 45 43 6c 69 63 6b | 4f 62 6a 65 63 74 50 72 |lWEClick|ObjectPr|
|00001bd0| 6f 63 28 68 69 74 50 74 | 2c 20 6d 6f 64 69 66 69 |oc(hitPt|, modifi|
|00001be0| 65 72 73 2c 20 63 6c 69 | 63 6b 54 69 6d 65 2c 20 |ers, cli|ckTime, |
|00001bf0| 68 4f 62 6a 65 63 74 44 | 65 73 63 2c 20 63 6c 69 |hObjectD|esc, cli|
|00001c00| 63 6b 48 61 6e 64 6c 65 | 72 29 3b 0d 09 09 7d 0d |ckHandle|r);...}.|
|00001c10| 09 7d 0d 0d 09 2f 2f 20 | 75 6e 6c 6f 63 6b 20 74 |.}...// |unlock t|
|00001c20| 68 65 20 6f 62 6a 65 63 | 74 20 64 65 73 63 72 69 |he objec|t descri|
|00001c30| 70 74 6f 72 0d 09 5f 57 | 45 53 65 74 48 61 6e 64 |ptor.._W|ESetHand|
|00001c40| 6c 65 4c 6f 63 6b 28 28 | 48 61 6e 64 6c 65 29 68 |leLock((|Handle)h|
|00001c50| 4f 62 6a 65 63 74 44 65 | 73 63 2c 20 73 61 76 65 |ObjectDe|sc, save|
|00001c60| 44 65 73 63 4c 6f 63 6b | 29 3b 0d 0d 09 72 65 74 |DescLock|);...ret|
|00001c70| 75 72 6e 20 63 6c 69 63 | 6b 48 61 6e 64 6c 65 64 |urn clic|kHandled|
|00001c80| 3b 0d 7d 0d 0d 70 61 73 | 63 61 6c 20 4f 53 45 72 |;.}..pas|cal OSEr|
|00001c90| 72 20 5f 57 45 53 74 72 | 65 61 6d 4f 62 6a 65 63 |r _WEStr|eamObjec|
|00001ca0| 74 28 53 49 6e 74 31 36 | 20 64 65 73 74 4b 69 6e |t(SInt16| destKin|
|00001cb0| 64 2c 20 46 6c 61 76 6f | 72 54 79 70 65 20 2a 74 |d, Flavo|rType *t|
|00001cc0| 68 65 54 79 70 65 2c 0d | 09 09 09 09 48 61 6e 64 |heType,.|....Hand|
|00001cd0| 6c 65 20 2a 74 68 65 44 | 61 74 61 2c 20 42 6f 6f |le *theD|ata, Boo|
|00001ce0| 6c 65 61 6e 20 2a 63 61 | 6e 44 69 73 70 6f 73 65 |lean *ca|nDispose|
|00001cf0| 44 61 74 61 2c 20 57 45 | 4f 62 6a 65 63 74 44 65 |Data, WE|ObjectDe|
|00001d00| 73 63 48 61 6e 64 6c 65 | 20 68 4f 62 6a 65 63 74 |scHandle| hObject|
|00001d10| 44 65 73 63 29 0d 7b 0d | 09 57 45 4f 62 6a 65 63 |Desc).{.|.WEObjec|
|00001d20| 74 44 65 73 63 20 2a 70 | 44 65 73 63 3b 0d 09 42 |tDesc *p|Desc;..B|
|00001d30| 6f 6f 6c 65 61 6e 20 73 | 61 76 65 44 65 73 63 4c |oolean s|aveDescL|
|00001d40| 6f 63 6b 3b 0d 09 4f 53 | 45 72 72 20 65 72 72 20 |ock;..OS|Err err |
|00001d50| 3d 20 77 65 4e 6f 74 48 | 61 6e 64 6c 65 64 45 72 |= weNotH|andledEr|
|00001d60| 72 3b 0d 0d 09 2a 63 61 | 6e 44 69 73 70 6f 73 65 |r;...*ca|nDispose|
|00001d70| 44 61 74 61 20 3d 20 74 | 72 75 65 3b 0d 0d 09 2f |Data = t|rue;.../|
|00001d80| 2f 20 6c 6f 63 6b 20 74 | 68 65 20 6f 62 6a 65 63 |/ lock t|he objec|
|00001d90| 74 20 64 65 73 63 72 69 | 70 74 6f 72 0d 09 73 61 |t descri|ptor..sa|
|00001da0| 76 65 44 65 73 63 4c 6f | 63 6b 20 3d 20 5f 57 45 |veDescLo|ck = _WE|
|00001db0| 53 65 74 48 61 6e 64 6c | 65 4c 6f 63 6b 28 28 48 |SetHandl|eLock((H|
|00001dc0| 61 6e 64 6c 65 29 68 4f | 62 6a 65 63 74 44 65 73 |andle)hO|bjectDes|
|00001dd0| 63 2c 20 74 72 75 65 29 | 3b 0d 09 70 44 65 73 63 |c, true)|;..pDesc|
|00001de0| 20 3d 20 2a 68 4f 62 6a | 65 63 74 44 65 73 63 3b | = *hObj|ectDesc;|
|00001df0| 0d 0d 09 69 66 20 28 70 | 44 65 73 63 2d 3e 6f 62 |...if (p|Desc->ob|
|00001e00| 6a 65 63 74 54 61 62 6c | 65 20 21 3d 20 6e 69 6c |jectTabl|e != nil|
|00001e10| 29 0d 09 7b 0d 09 09 57 | 45 53 74 72 65 61 6d 4f |)..{...W|EStreamO|
|00001e20| 62 6a 65 63 74 55 50 50 | 20 73 74 72 65 61 6d 48 |bjectUPP| streamH|
|00001e30| 61 6e 64 6c 65 72 20 3d | 20 28 2a 70 44 65 73 63 |andler =| (*pDesc|
|00001e40| 2d 3e 6f 62 6a 65 63 74 | 54 61 62 6c 65 29 5b 70 |->object|Table)[p|
|00001e50| 44 65 73 63 2d 3e 6f 62 | 6a 65 63 74 49 6e 64 65 |Desc->ob|jectInde|
|00001e60| 78 5d 2e 73 74 72 65 61 | 6d 48 61 6e 64 6c 65 72 |x].strea|mHandler|
|00001e70| 3b 0d 0d 09 09 2f 2f 20 | 63 61 6c 6c 20 74 68 65 |;....// |call the|
|00001e80| 20 73 74 72 65 61 6d 20 | 68 61 6e 64 6c 65 72 2c | stream |handler,|
|00001e90| 20 69 66 20 61 6e 79 0d | 09 09 69 66 20 28 73 74 | if any.|..if (st|
|00001ea0| 72 65 61 6d 48 61 6e 64 | 6c 65 72 20 21 3d 20 6e |reamHand|ler != n|
|00001eb0| 69 6c 29 0d 09 09 7b 0d | 09 09 09 65 72 72 20 3d |il)...{.|...err =|
|00001ec0| 20 43 61 6c 6c 57 45 53 | 74 72 65 61 6d 4f 62 6a | CallWES|treamObj|
|00001ed0| 65 63 74 50 72 6f 63 28 | 64 65 73 74 4b 69 6e 64 |ectProc(|destKind|
|00001ee0| 2c 20 74 68 65 54 79 70 | 65 2c 20 2a 74 68 65 44 |, theTyp|e, *theD|
|00001ef0| 61 74 61 2c 20 68 4f 62 | 6a 65 63 74 44 65 73 63 |ata, hOb|jectDesc|
|00001f00| 2c 20 73 74 72 65 61 6d | 48 61 6e 64 6c 65 72 29 |, stream|Handler)|
|00001f10| 3b 0d 09 09 7d 0d 09 7d | 0d 0d 09 69 66 20 28 65 |;...}..}|...if (e|
|00001f20| 72 72 20 3d 3d 20 77 65 | 4e 6f 74 48 61 6e 64 6c |rr == we|NotHandl|
|00001f30| 65 64 45 72 72 29 0d 09 | 7b 0d 09 09 2f 2f 20 64 |edErr)..|{...// d|
|00001f40| 65 66 61 75 6c 74 20 73 | 74 72 65 61 6d 69 6e 67 |efault s|treaming|
|00001f50| 20 62 65 68 61 76 69 6f | 72 0d 09 09 5f 57 45 46 | behavio|r..._WEF|
|00001f60| 6f 72 67 65 74 48 61 6e | 64 6c 65 28 74 68 65 44 |orgetHan|dle(theD|
|00001f70| 61 74 61 29 3b 0d 09 09 | 2a 63 61 6e 44 69 73 70 |ata);...|*canDisp|
|00001f80| 6f 73 65 44 61 74 61 20 | 3d 20 66 61 6c 73 65 3b |oseData |= false;|
|00001f90| 0d 09 09 2a 74 68 65 54 | 79 70 65 20 3d 20 70 44 |...*theT|ype = pD|
|00001fa0| 65 73 63 2d 3e 6f 62 6a | 65 63 74 54 79 70 65 3b |esc->obj|ectType;|
|00001fb0| 0d 09 09 2a 74 68 65 44 | 61 74 61 20 3d 20 70 44 |...*theD|ata = pD|
|00001fc0| 65 73 63 2d 3e 6f 62 6a | 65 63 74 44 61 74 61 48 |esc->obj|ectDataH|
|00001fd0| 61 6e 64 6c 65 3b 0d 09 | 09 65 72 72 20 3d 20 6e |andle;..|.err = n|
|00001fe0| 6f 45 72 72 3b 0d 09 7d | 0d 0d 09 2f 2f 20 75 6e |oErr;..}|...// un|
|00001ff0| 6c 6f 63 6b 20 74 68 65 | 20 6f 62 6a 65 63 74 20 |lock the| object |
|00002000| 64 65 73 63 72 69 70 74 | 6f 72 0d 09 5f 57 45 53 |descript|or.._WES|
|00002010| 65 74 48 61 6e 64 6c 65 | 4c 6f 63 6b 28 28 48 61 |etHandle|Lock((Ha|
|00002020| 6e 64 6c 65 29 20 68 4f | 62 6a 65 63 74 44 65 73 |ndle) hO|bjectDes|
|00002030| 63 2c 20 73 61 76 65 44 | 65 73 63 4c 6f 63 6b 29 |c, saveD|escLock)|
|00002040| 3b 0d 0d 09 72 65 74 75 | 72 6e 20 65 72 72 3b 0d |;...retu|rn err;.|
|00002050| 7d 0d 0d 70 61 73 63 61 | 6c 20 4f 53 45 72 72 20 |}..pasca|l OSErr |
|00002060| 57 45 49 6e 73 74 61 6c | 6c 4f 62 6a 65 63 74 48 |WEInstal|lObjectH|
|00002070| 61 6e 64 6c 65 72 28 46 | 6c 61 76 6f 72 54 79 70 |andler(F|lavorTyp|
|00002080| 65 20 6f 62 6a 65 63 74 | 54 79 70 65 2c 20 57 45 |e object|Type, WE|
|00002090| 53 65 6c 65 63 74 6f 72 | 20 68 61 6e 64 6c 65 72 |Selector| handler|
|000020a0| 53 65 6c 65 63 74 6f 72 | 2c 0d 09 09 09 09 55 6e |Selector|,.....Un|
|000020b0| 69 76 65 72 73 61 6c 50 | 72 6f 63 50 74 72 20 68 |iversalP|rocPtr h|
|000020c0| 61 6e 64 6c 65 72 2c 20 | 57 45 48 61 6e 64 6c 65 |andler, |WEHandle|
|000020d0| 20 68 57 45 29 0d 7b 0d | 09 57 45 4f 48 54 61 62 | hWE).{.|.WEOHTab|
|000020e0| 6c 65 48 61 6e 64 6c 65 | 20 68 54 61 62 6c 65 3b |leHandle| hTable;|
|000020f0| 0d 09 53 49 6e 74 33 32 | 20 69 6e 64 65 78 3b 0d |..SInt32| index;.|
|00002100| 09 57 45 4f 48 54 61 62 | 6c 65 45 6e 74 72 79 20 |.WEOHTab|leEntry |
|00002110| 65 6e 74 72 79 3b 0d 09 | 4f 53 45 72 72 20 65 72 |entry;..|OSErr er|
|00002120| 72 3b 0d 0d 09 2f 2f 20 | 69 66 20 68 57 45 20 69 |r;...// |if hWE i|
|00002130| 73 20 6e 69 6c 2c 20 69 | 6e 73 74 61 6c 6c 20 74 |s nil, i|nstall t|
|00002140| 68 65 20 68 61 6e 64 6c | 65 72 20 69 6e 20 74 68 |he handl|er in th|
|00002150| 65 20 67 6c 6f 62 61 6c | 20 68 61 6e 64 6c 65 72 |e global| handler|
|00002160| 20 74 61 62 6c 65 2c 0d | 09 2f 2f 20 6f 74 68 65 | table,.|.// othe|
|00002170| 72 77 69 73 65 20 69 6e | 73 74 61 6c 6c 20 74 68 |rwise in|stall th|
|00002180| 65 20 68 61 6e 64 6c 65 | 72 20 69 6e 20 74 68 65 |e handle|r in the|
|00002190| 20 69 6e 73 74 61 6e 63 | 65 2d 73 70 65 63 69 66 | instanc|e-specif|
|000021a0| 69 63 20 68 61 6e 64 6c | 65 72 20 74 61 62 6c 65 |ic handl|er table|
|000021b0| 0d 09 69 66 20 28 68 57 | 45 20 3d 3d 20 6e 69 6c |..if (hW|E == nil|
|000021c0| 29 0d 09 7b 0d 09 09 68 | 54 61 62 6c 65 20 3d 20 |)..{...h|Table = |
|000021d0| 5f 77 65 47 6c 6f 62 61 | 6c 4f 62 6a 65 63 74 48 |_weGloba|lObjectH|
|000021e0| 61 6e 64 6c 65 72 54 61 | 62 6c 65 3b 0d 09 7d 0d |andlerTa|ble;..}.|
|000021f0| 09 65 6c 73 65 0d 09 7b | 0d 09 09 68 54 61 62 6c |.else..{|...hTabl|
|00002200| 65 20 3d 20 28 2a 68 57 | 45 29 2d 3e 68 4f 62 6a |e = (*hW|E)->hObj|
|00002210| 65 63 74 48 61 6e 64 6c | 65 72 54 61 62 6c 65 3b |ectHandl|erTable;|
|00002220| 0d 09 7d 0d 0d 09 2f 2f | 20 63 72 65 61 74 65 20 |..}...//| create |
|00002230| 74 68 65 20 68 61 6e 64 | 6c 65 72 20 74 61 62 6c |the hand|ler tabl|
|00002240| 65 2c 20 69 66 20 69 74 | 20 64 6f 65 73 6e 27 74 |e, if it| doesn't|
|00002250| 20 65 78 69 73 74 0d 09 | 69 66 20 28 68 54 61 62 | exist..|if (hTab|
|00002260| 6c 65 20 3d 3d 20 6e 69 | 6c 29 0d 09 7b 0d 09 09 |le == ni|l)..{...|
|00002270| 68 54 61 62 6c 65 20 3d | 20 28 57 45 4f 48 54 61 |hTable =| (WEOHTa|
|00002280| 62 6c 65 48 61 6e 64 6c | 65 29 20 4e 65 77 48 61 |bleHandl|e) NewHa|
|00002290| 6e 64 6c 65 28 30 29 3b | 0d 09 09 69 66 20 28 28 |ndle(0);|...if ((|
|000022a0| 65 72 72 20 3d 20 4d 65 | 6d 45 72 72 6f 72 28 29 |err = Me|mError()|
|000022b0| 29 20 21 3d 20 6e 6f 45 | 72 72 29 0d 09 09 7b 0d |) != noE|rr)...{.|
|000022c0| 09 09 09 72 65 74 75 72 | 6e 20 65 72 72 3b 0d 09 |...retur|n err;..|
|000022d0| 09 7d 0d 09 09 69 66 20 | 28 68 57 45 20 3d 3d 20 |.}...if |(hWE == |
|000022e0| 6e 69 6c 29 0d 09 09 7b | 0d 09 09 09 5f 77 65 47 |nil)...{|...._weG|
|000022f0| 6c 6f 62 61 6c 4f 62 6a | 65 63 74 48 61 6e 64 6c |lobalObj|ectHandl|
|00002300| 65 72 54 61 62 6c 65 20 | 3d 20 68 54 61 62 6c 65 |erTable |= hTable|
|00002310| 3b 0d 09 09 7d 0d 09 09 | 65 6c 73 65 0d 09 09 7b |;...}...|else...{|
|00002320| 0d 09 09 09 28 2a 68 57 | 45 29 2d 3e 68 4f 62 6a |....(*hW|E)->hObj|
|00002330| 65 63 74 48 61 6e 64 6c | 65 72 54 61 62 6c 65 20 |ectHandl|erTable |
|00002340| 3d 20 68 54 61 62 6c 65 | 3b 0d 09 09 7d 0d 09 7d |= hTable|;...}..}|
|00002350| 0d 0d 09 2f 2f 20 6c 6f | 6f 6b 20 66 6f 72 20 74 |...// lo|ok for t|
|00002360| 68 65 20 65 6e 74 72 79 | 20 63 6f 72 72 65 73 70 |he entry| corresp|
|00002370| 6f 6e 64 69 6e 67 20 74 | 6f 20 74 68 65 20 73 70 |onding t|o the sp|
|00002380| 65 63 69 66 69 65 64 20 | 6f 62 6a 65 63 74 20 74 |ecified |object t|
|00002390| 79 70 65 0d 09 69 66 20 | 28 28 69 6e 64 65 78 20 |ype..if |((index |
|000023a0| 3d 20 5f 57 45 4c 6f 6f | 6b 75 70 4f 62 6a 65 63 |= _WELoo|kupObjec|
|000023b0| 74 54 79 70 65 28 6f 62 | 6a 65 63 74 54 79 70 65 |tType(ob|jectType|
|000023c0| 2c 20 68 54 61 62 6c 65 | 29 29 20 3d 3d 20 6b 55 |, hTable|)) == kU|
|000023d0| 6e 6b 6e 6f 77 6e 4f 62 | 6a 65 63 74 54 79 70 65 |nknownOb|jectType|
|000023e0| 29 0d 09 7b 0d 09 09 42 | 4c 4f 43 4b 5f 43 4c 52 |)..{...B|LOCK_CLR|
|000023f0| 28 65 6e 74 72 79 29 3b | 0d 09 09 65 6e 74 72 79 |(entry);|...entry|
|00002400| 2e 6f 62 6a 65 63 74 54 | 79 70 65 20 3d 20 6f 62 |.objectT|ype = ob|
|00002410| 6a 65 63 74 54 79 70 65 | 3b 0d 0d 09 09 2f 2f 20 |jectType|;....// |
|00002420| 70 72 65 76 69 6f 75 73 | 6c 79 20 75 6e 6b 6e 6f |previous|ly unkno|
|00002430| 77 6e 20 6f 62 6a 65 63 | 74 20 74 79 70 65 3a 20 |wn objec|t type: |
|00002440| 61 70 70 65 6e 64 20 61 | 20 6e 65 77 20 65 6e 74 |append a| new ent|
|00002450| 72 79 20 61 74 20 74 68 | 65 20 65 6e 64 20 6f 66 |ry at th|e end of|
|00002460| 20 74 68 65 20 68 61 6e | 64 6c 65 72 20 74 61 62 | the han|dler tab|
|00002470| 6c 65 0d 09 09 69 6e 64 | 65 78 20 3d 20 47 65 74 |le...ind|ex = Get|
|00002480| 48 61 6e 64 6c 65 53 69 | 7a 65 28 28 48 61 6e 64 |HandleSi|ze((Hand|
|00002490| 6c 65 29 20 68 54 61 62 | 6c 65 29 20 2f 20 73 69 |le) hTab|le) / si|
|000024a0| 7a 65 6f 66 28 57 45 4f | 48 54 61 62 6c 65 45 6e |zeof(WEO|HTableEn|
|000024b0| 74 72 79 29 3b 0d 09 09 | 69 66 20 28 28 65 72 72 |try);...|if ((err|
|000024c0| 20 3d 20 5f 57 45 53 70 | 6c 69 63 65 28 28 48 61 | = _WESp|lice((Ha|
|000024d0| 6e 64 6c 65 29 20 68 54 | 61 62 6c 65 2c 20 26 65 |ndle) hT|able, &e|
|000024e0| 6e 74 72 79 2c 20 73 69 | 7a 65 6f 66 28 65 6e 74 |ntry, si|zeof(ent|
|000024f0| 72 79 29 2c 20 2d 31 29 | 29 20 21 3d 20 6e 6f 45 |ry), -1)|) != noE|
|00002500| 72 72 29 0d 09 09 7b 0d | 09 09 09 72 65 74 75 72 |rr)...{.|...retur|
|00002510| 6e 20 65 72 72 3b 0d 09 | 09 7d 0d 09 7d 0d 0d 09 |n err;..|.}..}...|
|00002520| 2f 2f 20 69 6e 73 74 61 | 6c 6c 20 74 68 65 20 68 |// insta|ll the h|
|00002530| 61 6e 64 6c 65 72 0d 09 | 72 65 74 75 72 6e 20 5f |andler..|return _|
|00002540| 57 45 53 65 74 46 69 65 | 6c 64 28 5f 77 65 4f 62 |WESetFie|ld(_weOb|
|00002550| 6a 65 63 74 48 61 6e 64 | 6c 65 72 53 65 6c 65 63 |jectHand|lerSelec|
|00002560| 74 6f 72 54 61 62 6c 65 | 2c 20 68 61 6e 64 6c 65 |torTable|, handle|
|00002570| 72 53 65 6c 65 63 74 6f | 72 2c 20 28 53 49 6e 74 |rSelecto|r, (SInt|
|00002580| 33 32 20 2a 29 20 26 68 | 61 6e 64 6c 65 72 2c 20 |32 *) &h|andler, |
|00002590| 2a 68 54 61 62 6c 65 20 | 2b 20 69 6e 64 65 78 29 |*hTable |+ index)|
|000025a0| 3b 0d 7d 0d 0d 70 61 73 | 63 61 6c 20 4f 53 45 72 |;.}..pas|cal OSEr|
|000025b0| 72 20 57 45 47 65 74 4f | 62 6a 65 63 74 48 61 6e |r WEGetO|bjectHan|
|000025c0| 64 6c 65 72 28 46 6c 61 | 76 6f 72 54 79 70 65 20 |dler(Fla|vorType |
|000025d0| 6f 62 6a 65 63 74 54 79 | 70 65 2c 20 57 45 53 65 |objectTy|pe, WESe|
|000025e0| 6c 65 63 74 6f 72 20 68 | 61 6e 64 6c 65 72 53 65 |lector h|andlerSe|
|000025f0| 6c 65 63 74 6f 72 2c 0d | 09 09 09 09 55 6e 69 76 |lector,.|....Univ|
|00002600| 65 72 73 61 6c 50 72 6f | 63 50 74 72 20 2a 68 61 |ersalPro|cPtr *ha|
|00002610| 6e 64 6c 65 72 2c 20 57 | 45 48 61 6e 64 6c 65 20 |ndler, W|EHandle |
|00002620| 68 57 45 29 0d 7b 0d 09 | 57 45 4f 48 54 61 62 6c |hWE).{..|WEOHTabl|
|00002630| 65 48 61 6e 64 6c 65 20 | 68 54 61 62 6c 65 3b 0d |eHandle |hTable;.|
|00002640| 09 53 49 6e 74 33 32 20 | 69 6e 64 65 78 3b 0d 0d |.SInt32 |index;..|
|00002650| 09 2f 2f 20 69 66 20 68 | 57 45 20 69 73 20 6e 69 |.// if h|WE is ni|
|00002660| 6c 2c 20 6c 6f 6f 6b 20 | 66 6f 72 20 74 68 65 20 |l, look |for the |
|00002670| 68 61 6e 64 6c 65 72 20 | 69 6e 20 74 68 65 20 67 |handler |in the g|
|00002680| 6c 6f 62 61 6c 20 68 61 | 6e 64 6c 65 72 20 74 61 |lobal ha|ndler ta|
|00002690| 62 6c 65 2c 0d 09 2f 2f | 20 6f 74 68 65 72 77 69 |ble,..//| otherwi|
|000026a0| 73 65 20 6c 6f 6f 6b 20 | 69 6e 20 74 68 65 20 69 |se look |in the i|
|000026b0| 6e 73 74 61 6e 63 65 2d | 73 70 65 63 69 66 69 63 |nstance-|specific|
|000026c0| 20 68 61 6e 64 6c 65 72 | 20 74 61 62 6c 65 0d 09 | handler| table..|
|000026d0| 69 66 20 28 68 57 45 20 | 3d 3d 20 6e 69 6c 29 0d |if (hWE |== nil).|
|000026e0| 09 7b 0d 09 09 68 54 61 | 62 6c 65 20 3d 20 5f 77 |.{...hTa|ble = _w|
|000026f0| 65 47 6c 6f 62 61 6c 4f | 62 6a 65 63 74 48 61 6e |eGlobalO|bjectHan|
|00002700| 64 6c 65 72 54 61 62 6c | 65 3b 0d 09 7d 0d 09 65 |dlerTabl|e;..}..e|
|00002710| 6c 73 65 0d 09 7b 0d 09 | 09 68 54 61 62 6c 65 20 |lse..{..|.hTable |
|00002720| 3d 20 28 2a 68 57 45 29 | 2d 3e 68 4f 62 6a 65 63 |= (*hWE)|->hObjec|
|00002730| 74 48 61 6e 64 6c 65 72 | 54 61 62 6c 65 3b 0d 09 |tHandler|Table;..|
|00002740| 7d 0d 0d 09 2f 2f 20 66 | 69 72 73 74 20 6d 61 6b |}...// f|irst mak|
|00002750| 65 20 73 75 72 65 20 74 | 68 65 20 68 61 6e 64 6c |e sure t|he handl|
|00002760| 65 72 20 74 61 62 6c 65 | 20 65 78 69 73 74 73 0d |er table| exists.|
|00002770| 09 2f 2f 20 74 68 65 6e | 20 63 68 65 63 6b 20 74 |.// then| check t|
|00002780| 6f 20 73 65 65 20 69 66 | 20 61 6e 20 65 6e 74 72 |o see if| an entr|
|00002790| 79 20 66 6f 72 20 74 68 | 65 20 73 70 65 63 69 66 |y for th|e specif|
|000027a0| 69 65 64 20 6f 62 6a 65 | 63 74 20 74 79 70 65 20 |ied obje|ct type |
|000027b0| 69 73 20 70 72 65 73 65 | 6e 74 0d 09 69 66 20 28 |is prese|nt..if (|
|000027c0| 28 68 54 61 62 6c 65 20 | 3d 3d 20 6e 69 6c 29 20 |(hTable |== nil) |
|000027d0| 7c 7c 20 28 28 69 6e 64 | 65 78 20 3d 20 5f 57 45 ||| ((ind|ex = _WE|
|000027e0| 4c 6f 6f 6b 75 70 4f 62 | 6a 65 63 74 54 79 70 65 |LookupOb|jectType|
|000027f0| 28 6f 62 6a 65 63 74 54 | 79 70 65 2c 20 68 54 61 |(objectT|ype, hTa|
|00002800| 62 6c 65 29 29 20 3d 3d | 20 6b 55 6e 6b 6e 6f 77 |ble)) ==| kUnknow|
|00002810| 6e 4f 62 6a 65 63 74 54 | 79 70 65 29 29 0d 09 7b |nObjectT|ype))..{|
|00002820| 0d 09 09 72 65 74 75 72 | 6e 20 77 65 55 6e 6b 6e |...retur|n weUnkn|
|00002830| 6f 77 6e 4f 62 6a 65 63 | 74 54 79 70 65 45 72 72 |ownObjec|tTypeErr|
|00002840| 3b 0d 09 7d 0d 0d 09 2f | 2f 20 72 65 74 75 72 6e |;..}.../|/ return|
|00002850| 20 74 68 65 20 61 64 64 | 72 65 73 73 20 6f 66 20 | the add|ress of |
|00002860| 74 68 65 20 73 70 65 63 | 69 66 69 65 64 20 68 61 |the spec|ified ha|
|00002870| 6e 64 6c 65 72 0d 09 72 | 65 74 75 72 6e 20 5f 57 |ndler..r|eturn _W|
|00002880| 45 47 65 74 46 69 65 6c | 64 28 5f 77 65 4f 62 6a |EGetFiel|d(_weObj|
|00002890| 65 63 74 48 61 6e 64 6c | 65 72 53 65 6c 65 63 74 |ectHandl|erSelect|
|000028a0| 6f 72 54 61 62 6c 65 2c | 20 68 61 6e 64 6c 65 72 |orTable,| handler|
|000028b0| 53 65 6c 65 63 74 6f 72 | 2c 20 28 53 49 6e 74 33 |Selector|, (SInt3|
|000028c0| 32 20 2a 29 20 68 61 6e | 64 6c 65 72 2c 20 2a 68 |2 *) han|dler, *h|
|000028d0| 54 61 62 6c 65 20 2b 20 | 69 6e 64 65 78 29 3b 0d |Table + |index);.|
|000028e0| 7d 0d 0d 23 65 6e 64 69 | 66 20 20 2f 2f 20 57 41 |}..#endi|f // WA|
|000028f0| 53 54 45 5f 4f 42 4a 45 | 43 54 53 0d 00 00 00 00 |STE_OBJE|CTS.....|
|00002900| 00 00 01 00 00 00 01 00 | 00 00 00 00 00 00 00 1e |........|........|
|00002910| 7b 7d ff ff 24 01 7c 3a | 00 00 68 cc 00 00 ff ff |{}..$.|:|..h.....|
|00002920| 24 00 3b a3 00 00 3d f0 | 00 00 ff ff 24 00 c1 8a |$.;...=.|....$...|
|00002930| 0b 57 45 4f 62 6a 65 63 | 74 73 2e 63 64 69 74 69 |.WEObjec|ts.cditi|
|00002940| 6e 67 2e 63 63 63 74 73 | 32 70 65 72 6f 6d 6c 6d |ng.cccts|2peromlm|
|00002950| 02 00 54 45 58 54 43 57 | 49 45 01 00 ff ff ff ff |..TEXTCW|IE......|
|00002960| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002970| 00 00 aa d4 84 cb 00 00 | 28 7c 00 00 01 ac ff ff |........|(|......|
|00002980| 24 01 40 ed 00 00 65 fc | 2b 8a ff ff 24 01 4a d4 |$.@...e.|+...$.J.|
|00002990| 00 00 65 dc 07 f7 ff ff | 24 01 54 bb 00 00 67 d0 |..e.....|$.T...g.|
|000029a0| 4c e4 ff ff 24 01 5e a2 | 00 00 67 b0 11 51 ff ff |L...$.^.|..g..Q..|
|000029b0| 24 01 68 89 00 00 67 90 | 60 6d ff ff 24 01 72 e8 |$.h...g.|`m..$.r.|
|000029c0| 00 00 67 6c 10 49 ff ff | 20 01 73 ec 00 00 66 e0 |..gl.I..| .s...f.|
|000029d0| 00 00 ff ff 24 01 74 31 | 00 00 66 dc 65 63 65 64 |....$.t1|..f.eced|
|000029e0| 65 6e 63 65 3a 20 62 75 | 6c 6b 0d 0d 52 63 76 41 |ence: bu|lk..RcvA|
|000029f0| 00 00 00 05 00 0a 00 04 | 00 17 00 02 00 04 57 41 |........|......WA|
|00002a00| 00 00 01 00 00 00 01 00 | 00 00 00 00 00 00 00 1e |........|........|
|00002a10| 07 9f d0 c8 03 d2 00 00 | 00 1c 00 1e ff ff 00 00 |........|........|
|00002a20| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002a30| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002a40| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002a50| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002a60| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002a70| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+